/*
 * 	<pre>
 *	EasyPeas.
 *  Copyright (C) 2007 S Owen
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Aug 3, 2007
 * InvokerNotFoundException.java
 * </pre>
 */
package org.easypeas.exceptions;

import org.easypeas.invocation.Invoker;

/**
 * Exception thrown when an Invoker cannot be found, that was defined by the
 * System property
 * 
 * @author S Owen
 */
public class InvokerNotFoundException extends Exception {

	private static final long serialVersionUID = -6146512073410538593L;

	private final Invoker defaultInvoker;

	/**
	 * Instantiates a new invoker not found exception, taking a message to
	 * explain the error and the default invoker to use as an alternative.
	 * 
	 * @param msg
	 *            the message
	 * @param invoker
	 *            the default invoker
	 */
	public InvokerNotFoundException(String msg, Invoker invoker) {
		super(msg);
		this.defaultInvoker = invoker;
	}

	/**
	 * @return the default invoker as an alternative to the one not found.
	 */
	public Invoker getDefaultInvoker() {
		return defaultInvoker;
	}
}
